package com.zlm.entity;


import lombok.Data;
import lombok.Getter;
import lombok.Setter;


import java.util.Set;

@Getter
@Setter
public class Customer {

    private Integer id;

    private String name;

    private Set<Orders> orders;

    // 当我们输出的时候会调用orders,orders里面的toString方法会调用customer,会造成死循环

    @Override
    public String toString() {
        return "Customer{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
